{include file="public/head"}

<body>
<div id="wrapper">

    <div class="gray-bg dashbard-1">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <form class="form-horizontal m-t" id="commentForm">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">会员账号：</label>
                                    <div class="col-sm-8">
                                        <input id="username" name="username" value="{$UserInfo.username}" maxlength="50" type="text" class="form-control" required="" aria-required="true" readonly>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">操作账户：</label>
                                    <div class="col-sm-8">
                                        <select class="form-control m-b" id="type">
                                            <option value="1" {if condition="$Type eq 1"}selected{/if}>积分</option>
                                            <!--<option value="2" {if condition="$Type eq 2"}selected{/if}>炁点</option>-->
                                            <!--<option value="3" {if condition="$Type eq 3"}selected{/if}>股权</option>-->
                                            <option value="4" {if condition="$Type eq 4"}selected{/if}>余额</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">操作方式：</label>
                                    <div class="col-sm-8">
                                        <select class="form-control m-b" id="reward_type">
                                            <option value="1">增加</option>
                                            <option value="2">减少</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">操作数量：</label>
                                    <div class="col-sm-8">
                                        <input id="num" name="num" type="text" class="form-control" required="" aria-required="true" onkeyup="this.value= this.value.match(/\d+(\.\d{0,2})?/) ? this.value.match(/\d+(\.\d{0,2})?/)[0] : ''">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">备注：</label>
                                    <div class="col-sm-8">
                                        <input id="Remarks" name="Remarks"  maxlength="50" type="text" class="form-control" required="" aria-required="true" >
                                    </div>
                                </div>
                                <input type="hidden" id="id" value="{$UserInfo.id}">
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <button class="btn btn-primary" type="submit">确认修改</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


</div>
<script src="__STATIC__/Admin/js/jquery-2.1.1.min.js"></script>
<script src="__STATIC__/Admin/js/bootstrap.min.js?v=3.4.0"></script>
<script src="__STATIC__/Admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="__STATIC__/Admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/Admin/layer/layer.js"></script>
<script>
    $('form').submit(function (e) {
        e.preventDefault();
        $.ajax({
            type:"post",
            url:"{:url('User/UserBalance')}",
            data:{
                id:$('#id').val(),
                type:$('#type').val(),
                reward_type:$('#reward_type').val(),
                num:$('#num').val(),
                Remarks:$('#Remarks').val(),
            },
            dataType:"json",
            success:function(data){
                if(data.status == 1){
                    layer.msg(data.message,{icon: 6,time:1500},function () {
                        window.top.location.reload();
                    });
                }else{
                    layer.msg(data.message,{icon: 5,time:1500});
                }
            }
        })
    })
</script>
</body>

</html>
